//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.hustcad.plm.pdm.partbom.controller;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.TimeInterval;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.hustcad.plm.basic.log.LogEventEnum;
import com.hustcad.plm.basic.log.TyplmLogger;
import com.hustcad.plm.basic.util.TyplmLoggerUtil;
import com.hustcad.plm.pdm.audit.util.TyplmAuditLogUtil;
import com.hustcad.plm.pdm.common.model.dto.AttrFilterDTO;
import com.hustcad.plm.pdm.common.model.dto.search.SearchConditionDTO;
import com.hustcad.plm.pdm.common.model.vo.BusinessObjectVO;
import com.hustcad.plm.pdm.common.model.vo.search.ResultEntityVO;
import com.hustcad.plm.pdm.common.util.CommonUtil;
import com.hustcad.plm.pdm.middle.caddoc.model.dto.CadPartLinkDTO;
import com.hustcad.plm.pdm.partbom.dto.BomAddBatchCheckDTO;
import com.hustcad.plm.pdm.partbom.dto.BomAddCheckDTO;
import com.hustcad.plm.pdm.partbom.dto.BomCompareDTO;
import com.hustcad.plm.pdm.partbom.dto.BomFilterDTO;
import com.hustcad.plm.pdm.partbom.dto.ChildPartsFiltersDTO;
import com.hustcad.plm.pdm.partbom.dto.EquivalenceStatusDTO;
import com.hustcad.plm.pdm.partbom.dto.ExpandBomTreeByFilterDTO;
import com.hustcad.plm.pdm.partbom.dto.ExpandBomTreeFatherListDTO;
import com.hustcad.plm.pdm.partbom.dto.ExportBomCompareDTO;
import com.hustcad.plm.pdm.partbom.dto.ExportNeededBomParamDTO;
import com.hustcad.plm.pdm.partbom.dto.IbaQueryDTO;
import com.hustcad.plm.pdm.partbom.dto.InsertPartDTO;
import com.hustcad.plm.pdm.partbom.dto.NewPartBomView;
import com.hustcad.plm.pdm.partbom.dto.PartBomExcelDTO;
import com.hustcad.plm.pdm.partbom.dto.PartBomParamDTO;
import com.hustcad.plm.pdm.partbom.dto.PartBomTree;
import com.hustcad.plm.pdm.partbom.dto.PartBomTreeNode;
import com.hustcad.plm.pdm.partbom.dto.PartBomView;
import com.hustcad.plm.pdm.partbom.dto.PartByFatherOidDTO;
import com.hustcad.plm.pdm.partbom.dto.PartQueryDTO;
import com.hustcad.plm.pdm.partbom.dto.PartUsageLink;
import com.hustcad.plm.pdm.partbom.dto.QueryChildPartsDTO;
import com.hustcad.plm.pdm.partbom.dto.QueryIBADTO;
import com.hustcad.plm.pdm.partbom.dto.RefactorBomDTO;
import com.hustcad.plm.pdm.partbom.dto.ReplaceChildDTO;
import com.hustcad.plm.pdm.partbom.dto.ReplacePartDTO;
import com.hustcad.plm.pdm.partbom.dto.SaveIbaDTO;
import com.hustcad.plm.pdm.partbom.dto.SavePartAttrsDTO;
import com.hustcad.plm.pdm.partbom.dto.SavePartBomAttrsDTO;
import com.hustcad.plm.pdm.partbom.dto.SimilarCreateDTO;
import com.hustcad.plm.pdm.partbom.dto.SplitBOMDTO;
import com.hustcad.plm.pdm.partbom.dto.UpdatePartByOidListDTO;
import com.hustcad.plm.pdm.partbom.dto.ViewSwitchDTO;
import com.hustcad.plm.pdm.partbom.dto.bom.BatchSaveAsDTO;
import com.hustcad.plm.pdm.partbom.dto.bom.BomCondition;
import com.hustcad.plm.pdm.partbom.dto.bom.BomSaveAsDTO;
import com.hustcad.plm.pdm.partbom.dto.bom.TyplmConvertBomInputDTO;
import com.hustcad.plm.pdm.partbom.dto.bom.TyplmEquivalenceParamDTO;
import com.hustcad.plm.pdm.partbom.dto.bom.UpdateSpareBomDTO;
import com.hustcad.plm.pdm.partbom.dto.partimport.PartXmlGlobeNodeDTO;
import com.hustcad.plm.pdm.partbom.query.PartLevelBomQuery;
import com.hustcad.plm.pdm.partbom.service.TyplmPartBomService;
import com.hustcad.plm.pdm.partbom.service.TyplmPartDealLinkService;
import com.hustcad.plm.pdm.partbom.service.TyplmPartQueryExtService;
import com.hustcad.plm.pdm.partbom.service.TyplmPartService;
import com.hustcad.plm.pdm.partbom.service.batchimport.TyplmPartBomImportService;
import com.hustcad.plm.pdm.partbom.service.view.TyplmViewDefService;
import com.hustcad.plm.pdm.partbom.vo.BomCompareTreeVO;
import com.hustcad.plm.pdm.partbom.vo.HasRelativeObjVO;
import com.hustcad.plm.pdm.partbom.vo.MultiFactoryControlVO;
import com.hustcad.plm.pdm.partbom.vo.NotificationOption;
import com.hustcad.plm.pdm.partbom.vo.ObjVersionVO;
import com.hustcad.plm.pdm.partbom.vo.ParentPartDetailVO;
import com.hustcad.plm.pdm.partbom.vo.PartAttrColumnVO;
import com.hustcad.plm.pdm.partbom.vo.PartBomTreeByFilterVO;
import com.hustcad.plm.pdm.partbom.vo.PartBomTreeNodeTableData;
import com.hustcad.plm.pdm.partbom.vo.PartDetailsVO;
import com.hustcad.plm.pdm.partbom.vo.PartLevelVO;
import com.hustcad.plm.pdm.partbom.vo.PdmPartFormVO;
import com.hustcad.plm.pdm.partbom.vo.PdmPartInfoVO;
import com.hustcad.plm.pdm.partbom.vo.TyAttributeDefVO;
import com.hustcad.plm.pdm.partbom.vo.TyPartAllVO;
import com.hustcad.plm.pdm.partbom.vo.UpdatePartByOidListVO;
import com.hustcad.plm.pdm.partbom.vo.bom.TyplmStreamPartVO;
import com.hustcad.plm.pdm.partbom.vo.view.ViewNodeVO;
import com.hustcad.plm.pdm.partbom.vo.view.ViewTreeVO;
import com.ty.basic.entity.CTyEntityBaseDO;
import com.ty.basic.entity.IdentifierEntity;
import com.ty.basic.entity.audit.AuditLogDO;
import com.ty.basic.entity.part.EquivalenceLinkDO;
import com.ty.basic.entity.part.PartDO;
import com.ty.basic.entity.part.PartUsesOccurrenceDO;
import com.ty.basic.handler.exceptionhandler.exception.ResponseCodeEnum;
import com.ty.basic.handler.exceptionhandler.exception.TyException;
import com.ty.basic.response.ResponseResult;
import com.ty.basic.session.TyAccountContext;
import com.ty.basic.utils.ArgumentUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@Api(
        tags = {"BOM管理"}
)
@RequestMapping({"/rest/v1/bom"})
public class TyplmBomController {
    private static final Logger log = LoggerFactory.getLogger(TyplmBomController.class);
    @Resource
    private TyplmViewDefService typlmViewDefService;
    @Resource
    private TyplmPartDealLinkService typlmPartDealLinkService;
    @Resource
    private TyplmPartBomService typlmPartBomService;
    @Resource
    private TyplmPartBomImportService typlmPartBomImportService;
    @Resource
    private TyplmPartQueryExtService tyPartQueryExtService;
    @Resource
    private TyplmLogger typlmLogger;
    @Resource
    private TyplmPartService typlmPartService;
    private static final String PARAM_PARTID = "partId";

    public TyplmBomController() {
    }

    @ModelAttribute
    public void initUserInfo() {
        TyAccountContext.setLanguage("zh-CN");
    }

    /** @deprecated */
    @GetMapping({"/queryPartBomTreeNodeByParent"})
    @ApiOperation(
            value = "根据父查询单层Bom树节点",
            notes = "根据父查询单层Bom树节点",
            produces = "application/json; charset=utf-8"
    )
    @Deprecated
    public ResponseResult<List<PartBomTreeNode>> queryPartBomTreeNodeByParent(BigInteger partId, Boolean isLocation) {
        List<PartBomTreeNode> list = this.typlmPartBomService.queryPartBomTreeNodeByParent(partId, isLocation);
        return ResponseResult.success(list);
    }

    @PostMapping({"/saveBomViewList"})
    @Transactional(
            rollbackFor = {Exception.class}
    )
    @ApiOperation(
            value = "保存Bom视图",
            notes = "保存Bom视图",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Boolean> saveBomViewList(@RequestBody List<PartBomView> partBomViewList) {
        boolean isCutThenCopy = false;
        Iterator var3 = partBomViewList.iterator();

        while(true) {
            while(true) {
                PartBomView partBomView;
                do {
                    do {
                        if (!var3.hasNext()) {
                            this.typlmPartBomService.saveBomViewList(isCutThenCopy ? ListUtil.reverse(partBomViewList) : partBomViewList);
                            partBomViewList.forEach((partBomVO) -> {
                                List<PartBomTreeNode> bomTreeNodeList = partBomVO.getBomTreeNodeList();
                                AtomicBoolean flag = new AtomicBoolean(false);
                                if (CollUtil.isNotEmpty(bomTreeNodeList)) {
                                    bomTreeNodeList.forEach((node) -> {
                                        if ("add".equalsIgnoreCase(node.getAction()) || "delete".equalsIgnoreCase(node.getAction())) {
                                            flag.set(true);
                                        }

                                    });
                                }

                                if (flag.get() && Objects.nonNull(partBomVO.getParent()) && Objects.nonNull(partBomVO.getParent().getOid()) && StringUtils.isNotBlank(partBomVO.getParent().getOtype())) {
                                    this.typlmLogger.info(new CTyEntityBaseDO(partBomVO.getParent().getOid(), partBomVO.getParent().getOtype()), LogEventEnum.UPDATE_PRODUCT_STRUCT);
                                }

                            });
                            return ResponseResult.success();
                        }

                        partBomView = (PartBomView)var3.next();
                    } while(partBomView.getParent() == null);
                } while(!CollUtil.isNotEmpty(partBomView.getBomTreeNodeList()));

                Iterator var5 = partBomView.getBomTreeNodeList().iterator();

                while(var5.hasNext()) {
                    PartBomTreeNode partBomTreeNode = (PartBomTreeNode)var5.next();
                    if (partBomTreeNode.getSourceUsageLinkInfo() != null) {
                        isCutThenCopy = true;
                        break;
                    }
                }
            }
        }
    }

    @PostMapping({"/saveBomViewListImmediately"})
    @Transactional(
            rollbackFor = {Exception.class}
    )
    @ApiOperation(
            value = "即时保存Bom视图",
            notes = "即时保存Bom视图",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Map<BigInteger, Long>> saveBomViewListImmediately(@RequestBody List<PartBomView> partBomViewList) {
        boolean isCutThenCopy = false;
        Iterator var3 = partBomViewList.iterator();

        while(true) {
            while(true) {
                PartBomView partBomView;
                do {
                    do {
                        if (!var3.hasNext()) {
                            Map<BigInteger, Long> oidValueMap = this.typlmPartBomService.saveBomViewListImmediately(isCutThenCopy ? ListUtil.reverse(partBomViewList) : partBomViewList);
                            partBomViewList.forEach((partBomVO) -> {
                                List<PartBomTreeNode> bomTreeNodeList = partBomVO.getBomTreeNodeList();
                                AtomicBoolean flag = new AtomicBoolean(false);
                                if (CollUtil.isNotEmpty(bomTreeNodeList)) {
                                    bomTreeNodeList.forEach((node) -> {
                                        if ("add".equalsIgnoreCase(node.getAction()) || "delete".equalsIgnoreCase(node.getAction())) {
                                            flag.set(true);
                                        }

                                    });
                                }

                                if (flag.get() && Objects.nonNull(partBomVO.getParent()) && Objects.nonNull(partBomVO.getParent().getOid()) && StringUtils.isNotBlank(partBomVO.getParent().getOtype())) {
                                    this.typlmLogger.info(new CTyEntityBaseDO(partBomVO.getParent().getOid(), partBomVO.getParent().getOtype()), LogEventEnum.UPDATE_PRODUCT_STRUCT);
                                }

                            });
                            return ResponseResult.success(oidValueMap);
                        }

                        partBomView = (PartBomView)var3.next();
                    } while(partBomView.getParent() == null);
                } while(!CollUtil.isNotEmpty(partBomView.getBomTreeNodeList()));

                Iterator var5 = partBomView.getBomTreeNodeList().iterator();

                while(var5.hasNext()) {
                    PartBomTreeNode partBomTreeNode = (PartBomTreeNode)var5.next();
                    if (partBomTreeNode.getSourceUsageLinkInfo() != null) {
                        isCutThenCopy = true;
                        break;
                    }
                }
            }
        }
    }

    @ApiOperation(
            value = "根据结构oid查询位号信息",
            notes = "根据结构oid查询位号信息",
            produces = "application/json; charset=utf-8"
    )
    @GetMapping({"/queryPartUsesOccurrenceByUsageLinkOid"})
    public ResponseResult<List<PartUsesOccurrenceDO>> queryPartUsesOccurrenceByUsageLinkOid(BigInteger partUsageLinkoid) {
        return ResponseResult.success(this.typlmPartBomService.queryPartUsesOccurrenceByUsageLinkOid(partUsageLinkoid));
    }

    @PostMapping({"/newPartBomView"})
    @ApiOperation(
            value = "新建视图版本",
            notes = "新建视图版本",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<BigInteger> newPartBomView(@RequestBody NewPartBomView newPartBomView) {
        ArgumentUtils.checkArgumentEmpty(newPartBomView, "newPartBomView");

        try {
            this.typlmLogger.info(new CTyEntityBaseDO(CommonUtil.stringToBigInteger(newPartBomView.getOldPartID()), "ty.inteplm.part.CTyPart"), LogEventEnum.CREATE_VERSION);
            return ResponseResult.success(this.typlmPartBomService.newPartBomView(newPartBomView));
        } catch (Exception var3) {
            this.typlmLogger.errorInfo(new CTyEntityBaseDO(CommonUtil.stringToBigInteger(newPartBomView.getOldPartID()), "ty.inteplm.part.CTyPart"), LogEventEnum.CREATE_VERSION, var3);
            throw var3;
        }
    }

    @PostMapping({"/createAllNewPartBranch"})
    @ApiOperation(
            value = "新建视图分支(包含所有下级)",
            notes = "新建视图版本(包含所有下级)",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult createAllNewPartBranch(@RequestBody TyplmConvertBomInputDTO convertBomInputDTO) {
        ArgumentUtils.checkArgumentEmpty(convertBomInputDTO, "convertBomInputDTO");

        try {
            this.typlmLogger.info(new CTyEntityBaseDO(convertBomInputDTO.getOid(), convertBomInputDTO.getOtype()), LogEventEnum.CREATE_VERSION);
            TyPartAllVO allNewPartBranch = this.typlmPartBomService.createAllNewPartBranch(convertBomInputDTO);
            return ResponseResult.success(this.typlmPartService.queryPartDetails(allNewPartBranch.getOid(), allNewPartBranch.getOtype()));
        } catch (Exception var3) {
            this.typlmLogger.errorInfo(new CTyEntityBaseDO(convertBomInputDTO.getOid(), convertBomInputDTO.getOtype()), LogEventEnum.CREATE_VERSION, var3);
            throw var3;
        }
    }

    @PostMapping({"/copyBomView"})
    @ApiOperation(
            value = "复制BOM视图",
            notes = "复制BOM视图",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Boolean> copyBomView(@RequestBody JSONObject jsonObject) {
        ArgumentUtils.checkArgumentEmpty(jsonObject, "参数");
        this.typlmPartBomService.copyBom(jsonObject.getBigInteger("oldOID"), jsonObject.getBigInteger("newOID"));
        return ResponseResult.success();
    }

    /** @deprecated */
    @PostMapping({"/myCheckout"})
    @Deprecated
    @ApiOperation(
            value = "我的检出",
            notes = "我的检出",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<PartLevelVO>> myCheckout(@RequestBody PartLevelBomQuery levelBomQuery) {
        ArgumentUtils.checkArgumentEmpty(levelBomQuery, "参数");
        return ResponseResult.success(this.typlmPartBomService.myCheckout(levelBomQuery));
    }

    @PostMapping({"/myCheckoutPart"})
    @ApiOperation(
            value = "我的检出新",
            notes = "我的检出新 走筛选器",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<PartLevelVO>> myCheckoutPart(@RequestBody ExpandBomTreeByFilterDTO expandBomTreeByFilterDTO) {
        ArgumentUtils.checkArgumentEmpty(expandBomTreeByFilterDTO, "参数");
        return ResponseResult.success(this.typlmPartBomService.myCheckoutPart(expandBomTreeByFilterDTO));
    }

    /** @deprecated */
    @PostMapping({"/allCheckIn"})
    @ApiOperation(
            value = "全部检入",
            notes = "全部检入状态为wrk的当前节点及其子节点",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<BusinessObjectVO>> allCheckIn(@RequestBody PartLevelBomQuery levelBomQuery) {
        ArgumentUtils.checkArgumentEmpty(levelBomQuery, "参数");
        return ResponseResult.success(this.typlmPartBomService.allCheckIn(levelBomQuery));
    }

    /** @deprecated */
    @PostMapping({"/bomExport"})
    @ApiOperation(
            value = "BOM结构导出",
            notes = "BOM结构导出",
            produces = "application/json; charset=utf-8"
    )
    @Deprecated
    public void bomExport(@RequestBody PartLevelBomQuery levelBomQuery, HttpServletResponse response) {
        this.typlmPartBomService.bomExport(levelBomQuery, response);
    }

    /** @deprecated */
    @PostMapping({"/bomExportByFilter"})
    @ApiOperation(
            value = "BOM结构导出",
            notes = "BOM结构导出",
            produces = "application/json; charset=utf-8"
    )
    @Deprecated
    public void bomExportByFilter(@RequestBody ExpandBomTreeByFilterDTO expandBomTreeByFilterDTO, HttpServletResponse response) {
        this.typlmPartBomService.bomExportByFilter(expandBomTreeByFilterDTO, response);
    }

    @PostMapping({"/bomExportByNeeded"})
    @ApiOperation(
            value = "BOM子项导出",
            notes = "BOM子项导出",
            produces = "application/json; charset=utf-8"
    )
    public void bomExportByNeeded(@RequestBody ExportNeededBomParamDTO exportNeededBomParamDTO, HttpServletResponse response) {
        this.typlmPartBomService.bomExportByNeeded(exportNeededBomParamDTO, response);
    }

    /** @deprecated */
    @PostMapping({"/bomImport"})
    @ApiOperation(
            value = "BOM结构导入",
            notes = "BOM结构导入",
            produces = "application/json; charset=utf-8"
    )
    @Deprecated
    public ResponseResult<Map<String, List<PartBomExcelDTO>>> bomImport(MultipartFile multipartFile, InsertPartDTO insertPartDto) {
        try {
            return ResponseResult.success(this.typlmPartBomService.bomImport(multipartFile, insertPartDto));
        } catch (Exception var5) {
            AuditLogDO auditLogDO = new AuditLogDO();
            auditLogDO.setObjoid(BigInteger.ZERO);
            auditLogDO.setObjotype("ty.inteplm.part.CTyPart");
            auditLogDO.setContaineroidStr(insertPartDto.getContainerID());
            auditLogDO.setContainerotype(insertPartDto.getContainerType());
            auditLogDO.setDescription("BOM结构导入");
            TyplmAuditLogUtil.errorInfo(LogEventEnum.CRATE_OBJECT, auditLogDO, var5);
            throw var5;
        }
    }

    @PostMapping({"/batchImportPartAndBom"})
    @ApiOperation(
            value = "Excel批量导入零件和结构",
            notes = "Excel批量导入零件和结构",
            produces = "application/json; charset=utf-8"
    )
    @Transactional(
            rollbackFor = {Exception.class}
    )
    public ResponseResult<JSONArray> batchImportPartAndBom(BigInteger userOid, @RequestParam String globeNodeAttributes, List<MultipartFile> multipartFileList) {
        if (CollectionUtils.isEmpty(multipartFileList)) {
            return ResponseResult.fail("200", "导入失败！文件为空！");
        } else {
            PartXmlGlobeNodeDTO globeNodeDTO = (PartXmlGlobeNodeDTO)JSON.parseObject(globeNodeAttributes, PartXmlGlobeNodeDTO.class);
            JSONArray resultJson = this.typlmPartBomImportService.batchImportPartAndBom(globeNodeDTO, multipartFileList, userOid);
            if (resultJson != null) {
                for(int i = 0; i < resultJson.size(); ++i) {
                    JSONObject jsonObject = resultJson.getJSONObject(i);
                    if ("失败".equals(jsonObject.getString("status"))) {
                        AuditLogDO auditLogDO = new AuditLogDO();
                        auditLogDO.setObjoid(BigInteger.ZERO);
                        auditLogDO.setObjotype("ty.inteplm.part.CTyPart");
                        auditLogDO.setDescription(jsonObject.getString("message"));
                        TyplmAuditLogUtil.errorInfo(LogEventEnum.IMPORT, auditLogDO, (Exception)null);
                    }
                }
            }

            return ResponseResult.success(resultJson);
        }
    }

    /** @deprecated */
    @Deprecated
    @PostMapping({"/refactorBom"})
    @ApiOperation(
            value = "筛选器-根据条件重构bom树",
            notes = "筛选器-根据条件重构bom树",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<ViewSwitchDTO> refactorBom(@RequestBody RefactorBomDTO refactorBomDTO) {
        return ResponseResult.success(this.typlmPartBomService.refactorBom(refactorBomDTO));
    }

    /** @deprecated */
    @Deprecated
    @PostMapping({"/bomStructureUnfold"})
    @ApiOperation(
            value = "bom结构自定义展开/全部展开",
            notes = "bom结构自定义展开",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<PartBomTree>> bomStructureUnfold(@RequestBody PartLevelBomQuery levelBomQuery) {
        return ResponseResult.success(this.typlmPartBomService.bomStructureUnfold(levelBomQuery));
    }

    /** @deprecated */
    @PostMapping({"/bomStructureUnfoldWithConstraint"})
    @Deprecated
    @ApiOperation(
            value = "bom批量编辑展开",
            notes = "bom结构自定义展开,IBA带约束",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<PartBomTree>> bomStructureUnfoldWithConstraint(@RequestBody ExpandBomTreeByFilterDTO expandBomTreeByFilterDTO) {
        return ResponseResult.success(this.typlmPartBomService.bomStructureUnfoldWithConstraint(expandBomTreeByFilterDTO));
    }

    /** @deprecated */
    @PostMapping({"/bomAddCheck"})
    @Deprecated
    @ApiOperation(
            value = "BOM结构添加校验",
            notes = "BOM结构添加校验",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Boolean> bomAddCheck(@RequestBody BomAddCheckDTO bomAddCheckDTO) {
        ArgumentUtils.checkArgumentEmpty(bomAddCheckDTO, "参数");
        return ResponseResult.success(this.typlmPartBomService.bomAddCheck(bomAddCheckDTO));
    }

    @PostMapping({"/bomAddBatchCheck"})
    @ApiOperation(
            value = "BOM结构添加批量校验",
            notes = "BOM结构添加批量校验",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Boolean> bomAddBatchCheck(@RequestBody BomAddBatchCheckDTO bomAddBatchCheckDTO) {
        ArgumentUtils.checkArgumentEmpty(bomAddBatchCheckDTO, "参数");
        return ResponseResult.success(this.typlmPartBomService.bomAddBatchCheck(bomAddBatchCheckDTO));
    }

    @PostMapping({"/isViewValid"})
    @ApiOperation(
            value = "校验视图挂载的是否合法",
            notes = "校验视图挂载的是否合法",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult isViewValid(@RequestBody BomAddCheckDTO bomAddCheckDTO) {
        ArgumentUtils.checkArgumentEmpty(bomAddCheckDTO, "参数");
        ArgumentUtils.checkArgumentEmpty(bomAddCheckDTO.getParentViewName(), "父部件视图参数");
        ArgumentUtils.checkArgumentEmpty(bomAddCheckDTO.getViewNameList(), "子零部件视图参数");
        this.typlmPartBomService.isViewValid(bomAddCheckDTO);
        return ResponseResult.success();
    }

    @PostMapping({"/saveIBAbyMap"})
    @ApiOperation("bom扩展属性保存")
    public ResponseResult<Boolean> saveIBAbyMap(@RequestBody SaveIbaDTO saveIbaDto) {
        ArgumentUtils.checkArgumentNull(saveIbaDto, "扩展属性");
        this.typlmPartBomService.saveIBAbyMap(saveIbaDto);
        return ResponseResult.success();
    }

    @PostMapping({"/savePartBomAttr"})
    @ApiOperation("bom结构属性保存")
    public ResponseResult<PartUsageLink> savePartBomAttr(@RequestBody SaveIbaDTO saveIbaDto) {
        ArgumentUtils.checkArgumentNull(saveIbaDto, "属性");
        ArgumentUtils.checkArgumentNull(saveIbaDto.getObjId(), "结构ID");
        return ResponseResult.success(this.typlmPartBomService.savePartBomAttr(saveIbaDto));
    }

    @PostMapping({"/saveObjectLinkAttr"})
    @ApiOperation("关系iba属性保存")
    public ResponseResult<Object> saveObjectLinkAttr(@RequestBody SaveIbaDTO saveIbaDto) {
        ArgumentUtils.checkArgumentNull(saveIbaDto, "属性");
        ArgumentUtils.checkArgumentNull(saveIbaDto.getObjId(), "结构ID");
        ArgumentUtils.checkArgumentNull(saveIbaDto.getObjOtype(), "结构otype");
        this.typlmPartBomService.saveObjectLinkAttr(saveIbaDto);
        return ResponseResult.success();
    }

    @GetMapping({"/getPartUsageLinkInfo"})
    @ApiOperation("获取PartUsageLink包含扩展属性值")
    public ResponseResult<PartUsageLink> getPartUsageLinkInfo(BigInteger oid, String otype) {
        return ResponseResult.success(this.typlmPartBomService.getPartUsageLinkInfo(oid, otype));
    }

    /** @deprecated */
    @Deprecated
    @GetMapping({"/queryPartBomTreeNodeTableByParent"})
    @ApiOperation(
            value = "Table形式返回根据父查询单层Bom树节点",
            notes = "Table形式返回根据父查询单层Bom树节点",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PartBomTreeNodeTableData> queryPartBomTreeNodeTableByParent(BigInteger partId, Boolean isLocation) {
        PartBomTreeNodeTableData partBomTreeNodeTableData = this.typlmPartBomService.queryPartBomTreeNodeTableByParent(partId, isLocation);
        return ResponseResult.success(partBomTreeNodeTableData);
    }

    /** @deprecated */
    @Deprecated
    @PostMapping({"/queryPartBomTreeNodeTableByParentList"})
    @ApiOperation(
            value = "Table形式返回根据父查询Bom树节点,单层",
            notes = "Table形式返回根据父查询Bom树节点,单层",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PartBomTreeNodeTableData> queryPartBomTreeNodeTableByParentList(@RequestBody @Valid PartQueryDTO queryDTO) {
        PartBomTreeNodeTableData partBomTreeNodeTableData = this.typlmPartBomService.queryPartBomTreeNodeTableByParentList(queryDTO.getPartIds(), queryDTO.getIsLocation());
        return ResponseResult.success(partBomTreeNodeTableData);
    }

    @PostMapping({"/existChildNode"})
    @ApiOperation(
            value = "判断当前节点是否存在子节点",
            notes = "判断当前节点是否存在子节点",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Map<BigInteger, Boolean>> existChildNode(@RequestBody PartQueryDTO queryDTO) {
        ArgumentUtils.checkArgumentNull(queryDTO, "零部件参数");
        ArgumentUtils.checkArgumentNull(queryDTO.getPartIds(), "零部件id");
        return ResponseResult.success(this.typlmPartBomService.existChildNode(queryDTO.getPartIds()));
    }

    @PostMapping({"/batchInsertEquivalenceLink"})
    @ApiOperation(
            value = "批量新建对等链接",
            notes = "批量新建对等链接",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<TyPartAllVO>> batchInsertEquivalenceLink(@RequestBody List<TyplmEquivalenceParamDTO> equivalenceParamDTOList) {
        ArgumentUtils.checkArgumentEmpty(equivalenceParamDTOList, "equivalenceParamDTOList");
        List<EquivalenceLinkDO> equivalenceLinkDOS = this.typlmPartBomService.batchInsertEquivalenceLink(equivalenceParamDTOList);
        List<IdentifierEntity> boids = (List)equivalenceLinkDOS.stream().map((item) -> {
            return new IdentifierEntity(item.getBoid(), item.getBotype());
        }).collect(Collectors.toList());
        return ResponseResult.success(this.typlmPartBomService.queryObjeInfoForPartVo(boids));
    }

    @PostMapping({"/removeEquivalenceLink"})
    @ApiOperation(
            value = "批量移除对等连接",
            notes = "批量移除对等连接",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<Boolean>> removeEquivalenceLink(@RequestBody List<TyplmEquivalenceParamDTO> equivalenceParamDTOList) {
        ArgumentUtils.checkArgumentEmpty(equivalenceParamDTOList, "equivalenceParamDTOList");
        return ResponseResult.success(this.typlmPartBomService.removeEquivalenceLink(equivalenceParamDTOList));
    }

    @PostMapping({"/isExistEquivalenceLink"})
    @ApiOperation(
            value = "判断对等链接关系是否已存在",
            notes = "判断对等链接关系是否已存在",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Boolean> isExistEquivalenceLink(@RequestBody EquivalenceLinkDO equivalenceLinkDO) {
        ArgumentUtils.checkArgumentEmpty(equivalenceLinkDO, "equivalenceLinkDO");
        return ResponseResult.success(this.typlmPartBomService.isExistEquivalenceLink(equivalenceLinkDO));
    }

    @PostMapping({"/getDownStreamEquivalentLink"})
    @ApiOperation(
            value = "获取下游部件",
            notes = "获取下游部件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<PartDetailsVO>> getDownStreamEquivalentLink(@RequestBody List<BigInteger> upStreamPartOidList) {
        ArgumentUtils.checkArgumentEmpty(upStreamPartOidList, "upStreamPartOidList");
        return ResponseResult.success(this.typlmPartBomService.getDownStreamEquivalentLink(upStreamPartOidList));
    }

    @PostMapping({"/getUpStreamEquivalentLink"})
    @ApiOperation(
            value = "获取上游部件",
            notes = "获取上游部件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<PartDetailsVO>> getUpStreamEquivalentLink(@RequestBody List<BigInteger> downStreamPartOidList) {
        ArgumentUtils.checkArgumentEmpty(downStreamPartOidList, "downStreamPartOidList");
        return ResponseResult.success(this.typlmPartBomService.getUpStreamEquivalentLink(downStreamPartOidList));
    }

    @PostMapping({"/updateDownStream"})
    @ApiOperation(
            value = "批量更新下游对等链接",
            notes = "批量更新下游对等链接",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<TyPartAllVO>> updateDownStream(@RequestBody List<TyplmEquivalenceParamDTO> paramDTOList) {
        ArgumentUtils.checkArgumentEmpty(paramDTOList, "paramDTOList");
        List<EquivalenceLinkDO> equivalenceLinkDOS = this.typlmPartBomService.updateDownStream(paramDTOList);
        List<BigInteger> boids = (List)equivalenceLinkDOS.stream().map(EquivalenceLinkDO::getBoid).collect(Collectors.toList());
        return ResponseResult.success(this.typlmPartService.queryPartAllVOList(boids));
    }

    @PostMapping({"/getEquivalenceStatus"})
    @ApiOperation(
            value = "批量查看零件的上下游时态关系",
            notes = "批量查看零件的上下游时态关系",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Map<BigInteger, EquivalenceStatusDTO>> getEquivalenceStatus(@RequestBody List<BigInteger> partIdList, boolean isUp) {
        ArgumentUtils.checkArgumentEmpty(partIdList, "partIdList");
        ArgumentUtils.checkArgumentEmpty(isUp, "isUp");
        return ResponseResult.success(this.typlmPartBomService.getEquivalenceStatus(partIdList, isUp));
    }

    @PostMapping({"/queryUpAndDownStreamLatestVersion"})
    @ApiOperation(
            value = "查询上或下游对等部件最新未连接小版本",
            notes = "查询上或下游对等部件最新未连接小版本",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<TyplmStreamPartVO>> queryUpAndDownStreamLatestVersion(BigInteger partId, BigInteger viewId, boolean isUp) {
        ArgumentUtils.checkArgumentEmpty(partId, "partId");
        ArgumentUtils.checkArgumentEmpty(viewId, "viewId");
        ArgumentUtils.checkArgumentEmpty(isUp, "isUp");
        return ResponseResult.success(this.typlmPartBomService.queryUpAndDownStreamLatestVersion(partId, viewId, isUp));
    }

    @PostMapping({"/selectEquivalenceLinkByApart"})
    @ApiOperation(
            value = "查询上游对象对等链接清单",
            notes = "查询上游对象对等链接清单",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<EquivalenceLinkDO>> selectEquivalenceLinkByApart(@RequestBody PartDO partDO) {
        ArgumentUtils.checkArgumentEmpty(partDO, "partDO");
        return ResponseResult.success(this.typlmPartBomService.selectEquivalenceLinkByApart(partDO));
    }

    @PostMapping({"/selectEquivalenceLinkByBpart"})
    @ApiOperation(
            value = "查询下游游对象对等链接清单",
            notes = "查询下游游对象对等链接清单",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<EquivalenceLinkDO>> selectEquivalenceLinkByBpart(@RequestBody PartDO partDO) {
        ArgumentUtils.checkArgumentEmpty(partDO, "partDO");
        return ResponseResult.success(this.typlmPartBomService.selectEquivalenceLinkByBpart(partDO));
    }

    @PostMapping({"/selectEquivalenceLinkByB"})
    @ApiOperation(
            value = "通过B对象获取对等连接",
            notes = "通过B对象获取对等连接",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<TyPartAllVO>> selectEquivalenceLinkByB(@RequestBody IdentifierEntity param) {
        ArgumentUtils.checkArgumentEmpty(param, "param");
        List<EquivalenceLinkDO> equivalenceLinkDOS = this.typlmPartBomService.selectEquivalenceLinkByBobj(param);
        List<IdentifierEntity> boids = (List)equivalenceLinkDOS.stream().map((item) -> {
            return new IdentifierEntity(item.getAoid(), item.getAotype());
        }).collect(Collectors.toList());
        return ResponseResult.success(this.typlmPartBomService.queryObjeInfoForPartVo(boids));
    }

    @GetMapping({"/selectEquivalenceLinkByAB"})
    @ApiOperation(
            value = "根据AB对象查询对等链接清单",
            notes = "根据AB对象查询对等链接清单",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<EquivalenceLinkDO>> selectEquivalenceLinkByAB(@RequestBody BigInteger aoid, BigInteger boid) {
        ArgumentUtils.checkArgumentBlank(aoid, "aoid");
        ArgumentUtils.checkArgumentBlank(boid, "boid");
        return ResponseResult.success(this.typlmPartBomService.selectEquivalenceLinkByAB(aoid, boid));
    }

    @GetMapping({"/queryUpAndDownStreamPartView"})
    @ApiOperation(
            value = "查询对等链接下游或上游部件视图",
            notes = "查询对等链接下游或上游部件视图",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Map<String, TyPartAllVO>> queryUpAndDownStreamPartView(BigInteger partId, Boolean isUp) {
        ArgumentUtils.checkArgumentEmpty(partId, "partId");
        return ResponseResult.success(this.typlmPartBomService.queryUpAndDownStreamPartView(partId, isUp));
    }

    @GetMapping({"/queryUpAndDownStreamPartDetail"})
    @ApiOperation(
            value = "查询对等链接下游或上游部件详情",
            notes = "查询对等链接下游或上游部件详情",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Map<String, PartDetailsVO>> queryUpAndDownStreamPartDetail(BigInteger partId, Boolean isUp) {
        ArgumentUtils.checkArgumentEmpty(partId, "partId");
        Map<String, TyPartAllVO> stringTyPartAllVOMap = this.typlmPartBomService.queryUpAndDownStreamPartView(partId, isUp);
        Map<String, PartDetailsVO> result = new HashMap();
        Iterator var5 = stringTyPartAllVOMap.entrySet().iterator();

        while(var5.hasNext()) {
            Map.Entry<String, TyPartAllVO> stringTyPartAllVOEntry = (Map.Entry)var5.next();
            String key = (String)stringTyPartAllVOEntry.getKey();
            TyPartAllVO value = (TyPartAllVO)stringTyPartAllVOEntry.getValue();
            if (value != null) {
                PartDetailsVO partDetailsVO = this.typlmPartService.queryPartDetails(value.getOid(), value.getOtype());
                result.put(key, partDetailsVO);
            }
        }

        return ResponseResult.success(result);
    }

    @GetMapping({"/queryUpOrDownStreamPart"})
    @ApiOperation(
            value = "查询上游或下游部件",
            notes = "查询上游或下游部件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<TyplmStreamPartVO>> queryUpOrDownStreamPart(BigInteger partId, Boolean isUp) {
        ArgumentUtils.checkArgumentEmpty(partId, "partId");
        return ResponseResult.success(this.typlmPartBomService.queryUpOrDownStreamPart(partId, isUp));
    }

    @PostMapping({"/createNewDownStreamPart"})
    @ApiOperation(
            value = "新建下游部件",
            notes = "新建下游部件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PartDetailsVO> createNewDownStreamPart(@RequestBody TyplmConvertBomInputDTO convertBomInputDTO) {
        ArgumentUtils.checkArgumentEmpty(convertBomInputDTO, "convertBomInputDTO");
        this.typlmLogger.info(new CTyEntityBaseDO(convertBomInputDTO.getOid(), convertBomInputDTO.getOtype()), LogEventEnum.CREATE_VERSION);
        convertBomInputDTO.setPartName(StringUtils.trim(convertBomInputDTO.getPartName()));
        convertBomInputDTO.setPartNumber(StringUtils.trim(convertBomInputDTO.getPartNumber()));
        return ResponseResult.success(this.typlmPartBomService.createNewDownStreamPart(convertBomInputDTO));
    }

    /** @deprecated */
    @PostMapping({"/filterBomByCondition"})
    @Deprecated
    @ApiOperation(
            value = "bom筛选器",
            notes = "bom筛选器",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<ViewSwitchDTO> filterBomByCondition(@RequestBody BomFilterDTO bomFilterDTO) {
        return ResponseResult.success(this.typlmPartBomService.filterBomByCondition(bomFilterDTO));
    }

    /** @deprecated */
    @PostMapping({"/filterBomWithLevelByCondition"})
    @Deprecated
    @ApiOperation(
            value = "bom筛选器",
            notes = "bom筛选器",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<ViewSwitchDTO> filterBomWithLevelByCondition(@RequestBody BomFilterDTO bomFilterDTO) {
        ArgumentUtils.checkArgumentNull(bomFilterDTO, "筛选器参数");
        ArgumentUtils.checkArgumentNull(bomFilterDTO.getFatherOid(), "父级零部件oid");
        ArgumentUtils.checkArgumentNull(bomFilterDTO.getExpandLevel(), "展开层级");
        QueryChildPartsDTO queryChildPartsDTO = new QueryChildPartsDTO();
        queryChildPartsDTO.setFatherOid(bomFilterDTO.getFatherOid());
        queryChildPartsDTO.setFatherOtype(bomFilterDTO.getFatherOtype());
        queryChildPartsDTO.setExpandLevel(bomFilterDTO.getExpandLevel());
        List<ChildPartsFiltersDTO> conditions = new ArrayList();
        conditions.add(bomFilterDTO);
        queryChildPartsDTO.setConditions(conditions);
        return ResponseResult.success(this.typlmPartBomService.filterBomWithLevelByCondition(queryChildPartsDTO));
    }

    /** @deprecated */
    @PostMapping({"/filterBomWithLevel"})
    @Deprecated
    @ApiOperation(
            value = "bom筛选器(bom多视图管理器)",
            notes = "bom筛选器(bom多视图管理器)",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<ViewSwitchDTO> filterBomWithLevel(@RequestBody QueryChildPartsDTO queryChildPartsDTO) {
        ArgumentUtils.checkArgumentNull(queryChildPartsDTO);
        return ResponseResult.success(this.typlmPartBomService.filterBomWithLevelByCondition(queryChildPartsDTO));
    }

    @PostMapping({"/queryPartByPatherOid"})
    @ApiOperation(
            value = "根据零部件父oid获取所有子零部件",
            notes = "根据零部件父oid获取所有子零部件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PdmPartFormVO> queryPartByFatherOid(@Validated @RequestBody PartByFatherOidDTO fatherOidDTO) {
        PdmPartFormVO partBomEObj = this.typlmPartBomService.queryPartByFatherOid(fatherOidDTO);
        List<TyAttributeDefVO> ibaList = partBomEObj.getTyAttributeDefs();
        Map<String, TyAttributeDefVO> ibaMap = new HashMap();
        Iterator var5 = ibaList.iterator();

        while(var5.hasNext()) {
            TyAttributeDefVO iba = (TyAttributeDefVO)var5.next();
            if (ibaMap.get(iba.getName()) == null) {
                ibaMap.put(iba.getName(), iba);
            }
        }

        partBomEObj.setTyAttributeDefs(new ArrayList(ibaMap.values()));
        return ResponseResult.success(partBomEObj);
    }

    @PostMapping({"/updatePartByOidList"})
    @ApiOperation(
            value = "批量编辑Boom零部件",
            notes = "批量编辑Boom零部件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<UpdatePartByOidListVO>> updatePartByOidList(@Validated @RequestBody List<UpdatePartByOidListDTO> partByOidListDTOS) {
        return ResponseResult.success(this.typlmPartBomService.updatePartByOidList(partByOidListDTOS));
    }

    @GetMapping({"/getPartForm"})
    @ApiOperation(
            value = "查询零部件详情带form表单",
            notes = "查询零部件详情待form表单",
            produces = "application/json; charset=utf-8"
    )
    @ApiImplicitParam(
            name = "oid",
            value = "零部件oid"
    )
    public ResponseResult<PdmPartFormVO> getPartForm(@RequestParam @NotNull(
            message = "oid不能为空"
    ) BigInteger oid) {
        return ResponseResult.success(this.typlmPartBomService.getPartForm(oid));
    }

    /** @deprecated */
    @Deprecated
    @PostMapping({"/partInfoExport"})
    @ApiOperation(
            value = "零部件具体值方法生成标准的XML",
            notes = "零部件具体值方法生成标准的XML导出",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult partInfoExport(@RequestBody QueryChildPartsDTO queryChildPartsDTO, HttpServletRequest request) {
        return ResponseResult.success(this.typlmPartBomService.partInfoExport(queryChildPartsDTO, request));
    }

    /** @deprecated */
    @Deprecated
    @PostMapping({"/partPreview"})
    @ApiOperation(
            value = "部件预览",
            notes = "部件预览",
            produces = "application/json; charset=utf-8"
    )
    public void partPreview(@RequestBody QueryChildPartsDTO queryChildPartsDTO, HttpServletResponse response, HttpServletRequest request) {
        TimeInterval timeInterval = new TimeInterval();
        timeInterval.start();
        this.typlmPartBomService.partPreview(queryChildPartsDTO, response, request);
        log.info("部件预览/partPreview耗时：" + timeInterval.interval());
    }

    @PostMapping({"/partPreviewNew"})
    @ApiOperation(
            value = "部件预览",
            notes = "部件预览",
            produces = "application/json; charset=utf-8"
    )
    public void partPreviewNew(@RequestBody QueryChildPartsDTO queryChildPartsDTO, HttpServletResponse response, HttpServletRequest request) {
        TimeInterval timeInterval = new TimeInterval();
        timeInterval.start();
        this.typlmPartBomService.partPreviewNew(queryChildPartsDTO, response, request);
        TyplmLoggerUtil.debug(log, "部件预览/partPreviewNew耗时：" + timeInterval.interval(), new Object[0]);
    }

    /** @deprecated */
    @Deprecated
    @PostMapping({"/partInfoExportNew"})
    @ApiOperation(
            value = "零部件具体值方法生成标准的XML",
            notes = "零部件具体值方法生成标准的XML导出",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult partInfoExportNew(@RequestBody QueryChildPartsDTO queryChildPartsDTO, HttpServletRequest request) {
        return ResponseResult.success(this.typlmPartBomService.partInfoExportNew(queryChildPartsDTO, request));
    }

    /** @deprecated */
    @PostMapping({"/getBomOccurrence"})
    @Deprecated
    @ApiOperation(
            value = "展开bom具体值",
            notes = "展开bom具体值",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<ViewSwitchDTO> queryBomOccurrence(@RequestBody BomFilterDTO bomFilterDTO) {
        QueryChildPartsDTO queryChildPartsDTO = new QueryChildPartsDTO();
        queryChildPartsDTO.setFatherOid(bomFilterDTO.getFatherOid());
        queryChildPartsDTO.setFatherOtype(bomFilterDTO.getFatherOtype());
        queryChildPartsDTO.setExpandLevel("N");
        queryChildPartsDTO.setGiveUsesOccurrence("Y");
        List<ChildPartsFiltersDTO> conditions = new ArrayList();
        conditions.add(bomFilterDTO);
        queryChildPartsDTO.setConditions(conditions);
        return ResponseResult.success(this.typlmPartBomService.queryBomOccurrence(queryChildPartsDTO));
    }

    /** @deprecated */
    @PostMapping({"/queryBomOccurrence"})
    @Deprecated
    @ApiOperation(
            value = "展开bom具体值",
            notes = "展开bom具体值",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<ViewSwitchDTO> queryBomOccurrence(@RequestBody QueryChildPartsDTO queryChildPartsDTO) {
        ArgumentUtils.checkArgumentNull(queryChildPartsDTO);
        queryChildPartsDTO.setExpandLevel("N");
        queryChildPartsDTO.setGiveUsesOccurrence("Y");
        return ResponseResult.success(this.typlmPartBomService.queryBomOccurrence(queryChildPartsDTO));
    }

    @PostMapping({"/partHasRelativeObj"})
    @ApiOperation(
            value = "判断零部件是否关联相关对象",
            notes = "判断零部件是否关联相关对象",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<HasRelativeObjVO>> isPartHasRelativeObj(@RequestBody List<BigInteger> partOids) {
        return ResponseResult.success(this.tyPartQueryExtService.isPartHasRelativeObj(partOids));
    }

    /** @deprecated */
    @PostMapping({"/queryObjAllAttrByOtype"})
    @Deprecated
    @ApiOperation(
            value = "批量编辑BOM结构属性设置列",
            notes = "批量编辑BOM结构属性设置列",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<PartAttrColumnVO>> queryObjAllAttrByOtype(@RequestBody List<String> otypes) {
        return ResponseResult.success(this.typlmPartBomService.queryObjAllAttrByOtype(otypes));
    }

    /** @deprecated */
    @PostMapping({"/batchSavePartAttrs"})
    @Transactional(
            rollbackFor = {Exception.class}
    )
    @Deprecated
    @ApiOperation(
            value = "批量编辑BOM",
            notes = "批量编辑BOM",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<BigInteger> batchSavePartAttrs(@RequestBody List<SavePartAttrsDTO> attrsDtoList)
            throws Exception {
        if (CollUtil.isEmpty(attrsDtoList) || CollUtil.isEmpty((Collection)attrsDtoList.stream().map(SavePartAttrsDTO::getOid).collect(Collectors.toList())) && CollUtil.isEmpty((Collection)attrsDtoList.stream().map(SavePartAttrsDTO::getParentPartOid).collect(Collectors.toList()))) {
            TyException.throwSingleTyExceptionVarargs(ResponseCodeEnum.ACC_PARAMETER_IS_NULL, new String[]{"oid"});
        }

        Iterator var3;
        SavePartAttrsDTO savePartAttrsDTO;
        try {
            BigInteger rootOid = this.typlmPartBomService.batchSavePartAttrs(attrsDtoList);
            var3 = attrsDtoList.iterator();

            while(var3.hasNext()) {
                savePartAttrsDTO = (SavePartAttrsDTO)var3.next();
                this.typlmLogger.info(new CTyEntityBaseDO(savePartAttrsDTO.getOid(), "ty.inteplm.part.CTyPart"), LogEventEnum.UPDATE_OBJECT);
            }

            return ResponseResult.success(rootOid);
        } catch (Exception var5) {
            Exception exception = var5;
            var3 = attrsDtoList.iterator();

            while(var3.hasNext()) {
                savePartAttrsDTO = (SavePartAttrsDTO)var3.next();
                this.typlmLogger.errorInfo(new CTyEntityBaseDO(savePartAttrsDTO.getOid(), "ty.inteplm.part.CTyPart"), LogEventEnum.UPDATE_OBJECT, exception);
            }

            throw exception;
        }
    }

    @PostMapping({"/batchSavePartBomAttrs"})
    @Transactional(
            rollbackFor = {Exception.class}
    )
    @ApiOperation(
            value = "批量编辑BOM",
            notes = "批量编辑BOM",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<BigInteger> batchSavePartBomAttrs(@RequestBody SavePartBomAttrsDTO savePartBomAttrsDTO)
            throws Exception {
        ArgumentUtils.checkArgumentNull(savePartBomAttrsDTO, "savePartBomAttrsDTO");

        Iterator var3;
        SavePartAttrsDTO savePartAttrsDTO;
        try {
            BigInteger rootOid = this.typlmPartBomService.batchSavePartBomAttrs(savePartBomAttrsDTO);
            var3 = savePartBomAttrsDTO.getSavePartAttrsDTOList().iterator();

            while(var3.hasNext()) {
                savePartAttrsDTO = (SavePartAttrsDTO)var3.next();
                this.typlmLogger.info(new CTyEntityBaseDO(savePartAttrsDTO.getOid(), "ty.inteplm.part.CTyPart"), LogEventEnum.UPDATE_OBJECT);
            }

            return ResponseResult.success(rootOid);
        } catch (Exception var5) {
            Exception exception = var5;
            var3 = savePartBomAttrsDTO.getSavePartAttrsDTOList().iterator();

            while(var3.hasNext()) {
                savePartAttrsDTO = (SavePartAttrsDTO)var3.next();
                this.typlmLogger.errorInfo(new CTyEntityBaseDO(savePartAttrsDTO.getOid(), "ty.inteplm.part.CTyPart"), LogEventEnum.UPDATE_OBJECT, exception);
            }

            throw exception;
        }
    }

    /** @deprecated */
    @PostMapping({"/expandBomTreeByFilter"})
    @ApiOperation(
            value = "bom筛选器",
            notes = "bom筛选器",
            produces = "application/json; charset=utf-8"
    )
    @Deprecated
    public ResponseResult<PartBomTreeByFilterVO> expandBomTreeByFilter(@RequestBody ExpandBomTreeByFilterDTO expandBomTreeByFilterDTO) {
        PartBomTreeByFilterVO result = this.typlmPartBomService.expandBomTreeByFilter(expandBomTreeByFilterDTO);
        return ResponseResult.success(result);
    }

    @PostMapping({"/expandBomTreeByFilterNew"})
    @ApiOperation(
            value = "bom筛选器",
            notes = "bom筛选器",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PartBomTreeByFilterVO> expandBomTreeByFilterNew(@RequestBody ExpandBomTreeByFilterDTO expandBomTreeByFilterDTO) {
        PartBomTreeByFilterVO result = this.typlmPartBomService.expandBomTreeByFilterNew(expandBomTreeByFilterDTO, Boolean.TRUE);
        return ResponseResult.success(result);
    }

    @PostMapping({"/expandBomTreeByFathers"})
    @ApiOperation(
            value = "bom筛选器-批量",
            notes = "bom筛选器-批量",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Map<String, PartBomTreeByFilterVO>> expandBomTreeByFathers(@RequestBody ExpandBomTreeFatherListDTO expandBomTreeFatherListDTO) {
        Map<String, PartBomTreeByFilterVO> result = this.typlmPartBomService.expandBomTreeByFathers(expandBomTreeFatherListDTO);
        return ResponseResult.success(result);
    }

    @PostMapping({"/batchExpandBomTreeByFilters"})
    @ApiOperation(
            value = "bom批量筛选器",
            notes = "bom批量筛选器",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Map<String, PartBomTreeByFilterVO>> expandBomTreeByFilters(@RequestBody List<ExpandBomTreeByFilterDTO> expandBomTreeByFilterDTOList) {
        Map<String, PartBomTreeByFilterVO> result = this.typlmPartBomService.batchExpandBomTreeByFilters(expandBomTreeByFilterDTOList);
        return ResponseResult.success(result);
    }

    /** @deprecated */
    @PostMapping({"/bomStructurePreview"})
    @Deprecated
    @ApiOperation(
            value = "BOM结构预览",
            notes = "BOM结构预览",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Map<String, PartBomTreeByFilterVO>> bomStructurePreview(@RequestBody TyplmConvertBomInputDTO typlmConvertBomInputDTO) {
        Map<String, PartBomTreeByFilterVO> result = this.typlmPartBomService.bomStructurePreview(typlmConvertBomInputDTO);
        return ResponseResult.success(result);
    }

    @PostMapping({"/createDownStreamBom"})
    @Transactional(
            rollbackFor = {Exception.class}
    )
    @ApiOperation(
            value = "创建新的bom结构",
            notes = "创建新的bom结构",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PartDetailsVO> createDownStreamBom(@RequestBody BatchSaveAsDTO batchSaveAsDTO) {
        TimeInterval timeInterval = new TimeInterval();
        timeInterval.start();
        PartDetailsVO downStreamBom = this.typlmPartBomService.createDownStreamBom(batchSaveAsDTO);
        log.info("创建新的bom结构,耗时：" + timeInterval.interval());
        return ResponseResult.success(downStreamBom);
    }

    @PostMapping({"/getPartBomIBA"})
    @ApiOperation(
            value = "",
            notes = "bom的分类和IBA",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<PartBomTree>> getPartBomIBA(@RequestBody IbaQueryDTO ibaQueryDTO) {
        List<PartBomTree> result = this.typlmPartBomService.getPartBomIBA(ibaQueryDTO.getBomList(), ibaQueryDTO.getIbaColumns());
        return ResponseResult.success(result);
    }

    @PostMapping({"/bomCompare"})
    @ApiOperation(
            value = "bom比较",
            notes = "bom比较",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<BomCompareTreeVO> bomCompare(@RequestBody BomCompareDTO bomCompareDTO) {
        return ResponseResult.success(this.typlmPartBomService.bomCompare(bomCompareDTO));
    }

    @PostMapping({"/exportBomCompare"})
    @ApiOperation(
            value = "BOM比较导出",
            notes = "BOM比较导出",
            produces = "application/json; charset=utf-8"
    )
    public void exportBomCompare(@RequestBody ExportBomCompareDTO exportBomCompareDTO, HttpServletResponse response) {
        this.typlmPartBomService.exportBomCompare(exportBomCompareDTO, response);
    }

    @PostMapping({"/similarCreate"})
    @Transactional(
            rollbackFor = {Exception.class}
    )
    @ApiOperation(
            value = "类似创建",
            notes = "类似创建",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PdmPartInfoVO> similarCreate(@RequestBody List<MultipartFile> fileList, HttpServletRequest request) {
        SimilarCreateDTO similarCreateDTO = (SimilarCreateDTO)JSON.parseObject(request.getParameter("similarCreateDTO"), SimilarCreateDTO.class);
        ArgumentUtils.checkArgumentNull(similarCreateDTO, "类似创建入参");
        similarCreateDTO.setFileList(fileList);

        try {
            return ResponseResult.success(this.typlmPartBomService.similarCreate(similarCreateDTO));
        } catch (Exception var7) {
            InsertPartDTO insertPartDTO = similarCreateDTO.getInsertPartDTO();
            AuditLogDO auditLogDO = new AuditLogDO();
            auditLogDO.setObjoid(BigInteger.ZERO);
            auditLogDO.setObjotype(insertPartDTO.getOType());
            auditLogDO.setContaineroidStr(insertPartDTO.getContainerID());
            auditLogDO.setContainerotype(insertPartDTO.getContainerType());
            auditLogDO.setTargetname(insertPartDTO.getName());
            auditLogDO.setTargetnumber(insertPartDTO.getPartNumber());
            auditLogDO.setTargetsecuritylabels(insertPartDTO.getSecuritylabels());
            auditLogDO.setFolderpath(insertPartDTO.getFolderPath());
            this.typlmLogger.errorInfo(LogEventEnum.CRATE_OBJECT, auditLogDO, var7);
            throw var7;
        }
    }

    @GetMapping({"getCompareVersionList"})
    @ApiOperation(
            value = "获取用于比较的版本列表",
            notes = "获取用于比较的版本列表",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<ObjVersionVO>> getCompareVersionList(BigInteger masteredoid, String otype) {
        return ResponseResult.success(this.typlmPartBomService.getCompareVersionList(masteredoid, otype));
    }

    @PostMapping({"/replaceChildByMasterOid"})
    @ApiOperation(
            value = "替换子件",
            notes = "替换子件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PartBomTree> replaceChildByMasterOid(@RequestBody ReplaceChildDTO replaceChildDto) {
        return ResponseResult.success(this.typlmPartBomService.replaceChildByMasterOid(replaceChildDto));
    }

    @GetMapping({"/checkPartNumberExistsByView"})
    @ApiOperation(
            value = "校验部件编码是否存在",
            notes = "校验部件编码是否存在",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Boolean> checkPartNumberExistsByView(String partNumber, String view) {
        return ResponseResult.success(this.typlmPartBomService.checkPartNumberExistsByView(partNumber, view));
    }

    @GetMapping({"/getViewTree"})
    @ApiOperation(
            value = "获取视图树",
            notes = "获取视图树",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<ViewTreeVO> getViewTree() {
        return ResponseResult.success(this.typlmViewDefService.getViewTree());
    }

    @GetMapping({"/queryCurrentViewTreeByViewID"})
    @ApiOperation(
            value = "查询指定视图以及所有下级视图树",
            notes = "查询指定视图以及所有下级视图树",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<ViewNodeVO> queryCurrentViewTreeByViewName(BigInteger viewID) {
        return ResponseResult.success(this.typlmViewDefService.queryCurrentViewTreeByViewName(viewID));
    }

    /** @deprecated */
    @PostMapping({"/removePartBom"})
    @Deprecated
    @ApiOperation(
            value = "移除指定部件的bom结构关系",
            notes = "按条件查询零部件关联的CAD文档",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Object> removePartBom(@RequestBody PartBomParamDTO paramDTO) {
        this.typlmPartDealLinkService.removePartBom(paramDTO);
        return ResponseResult.success();
    }

    /** @deprecated */
    @PostMapping({"/saveAsBoms"})
    @Transactional(
            rollbackFor = {Exception.class}
    )
    @Deprecated
    @ApiOperation(
            value = "另存bom结构",
            notes = "另存bom结构",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<Boolean> saveAsBoms(@RequestBody BatchSaveAsDTO batchSaveAsDTO) throws Exception {
        ArgumentUtils.checkArgumentNull(batchSaveAsDTO, "另存bom结构");

        try {
            this.typlmPartBomService.batchSaveAsPartBom(batchSaveAsDTO);
            return ResponseResult.success();
        } catch (Exception var7) {
            Exception exception = var7;
            List<BomSaveAsDTO> bomSaveAsList = batchSaveAsDTO.getBomSaveAsList();
            if (!CollectionUtils.isEmpty(bomSaveAsList)) {
                Iterator var4 = bomSaveAsList.iterator();

                while(var4.hasNext()) {
                    BomSaveAsDTO bomSaveAsDTO = (BomSaveAsDTO)var4.next();
                    AuditLogDO auditLogDO = new AuditLogDO();
                    auditLogDO.setObjoid(BigInteger.ZERO);
                    auditLogDO.setContaineroid(bomSaveAsDTO.getContainerOid());
                    auditLogDO.setContainerotype(bomSaveAsDTO.getContainerOtype());
                    auditLogDO.setObjotype("ty.inteplm.part.CTyPart");
                    auditLogDO.setTargetname(bomSaveAsDTO.getName());
                    auditLogDO.setTargetidentity(bomSaveAsDTO.getName());
                    auditLogDO.setTargetnumber(bomSaveAsDTO.getPartNumber());
                    TyplmAuditLogUtil.errorInfo(bomSaveAsDTO.getPartOid(), "ty.inteplm.part.CTyPart", LogEventEnum.SAVE_AS, exception);
                }
            }

            throw exception;
        }
    }

    @PostMapping({"/expandBomOccurrence"})
    @ApiOperation(
            value = "展开bom具体值",
            notes = "展开bom具体值",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PartBomTreeByFilterVO> expandBomOccurrence(@RequestBody ExpandBomTreeByFilterDTO expandBomTreeByFilterDTO) {
        return ResponseResult.success(this.typlmPartBomService.expandBomOccurrence(expandBomTreeByFilterDTO));
    }

    @GetMapping({"/multiFactoryDisplayControl"})
    @ApiOperation(
            value = "多工厂按钮显示控制",
            notes = "多工厂按钮显示控制",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<MultiFactoryControlVO>> multiFactoryDisplayControl(String viewName) {
        return ResponseResult.success(this.typlmPartBomService.multiFactoryDisplayControl(viewName));
    }

    @PostMapping({"/judgeExistByFilter"})
    @ApiOperation(
            value = "校验当前部件是否可以通过筛选器的筛选",
            notes = "校验当前部件是否可以通过筛选器的筛选",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<NotificationOption> judgeExistByFilter(@RequestBody NotificationOption notificationOption) {
        QueryChildPartsDTO queryChildPartsDTO = new QueryChildPartsDTO();
        queryChildPartsDTO.setConditions(notificationOption.getConditions());
        queryChildPartsDTO.setMultiFactoryFilterBomLogic(notificationOption.getMultiFactoryFilterBomLogic());
        TyPartAllVO tyPartAllVO = new TyPartAllVO();
        if (notificationOption.getTyPartAllVO() != null) {
            tyPartAllVO = notificationOption.getTyPartAllVO();
        } else if (notificationOption.getPartDetailsVO() != null && StringUtils.isNotBlank(notificationOption.getPartDetailsVO().getOid())) {
            tyPartAllVO = this.typlmPartService.queryPartAllVO(new BigInteger(notificationOption.getPartDetailsVO().getOid()), "ty.inteplm.part.CTyPart");
        }

        return ResponseResult.success(this.typlmPartBomService.judgeExistByFilter(queryChildPartsDTO, tyPartAllVO));
    }

    @PostMapping({"/getSpareBomList"})
    @ApiOperation(
            value = "获取备用bom列表",
            notes = "获取备用bom列表",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<TyPartAllVO>> getSpareBomList(@RequestBody BomCondition bomCondition) {
        return ResponseResult.success(this.typlmPartBomService.getSpareBomList(bomCondition));
    }

    @PostMapping({"/queryPartByBomCondition"})
    @ApiOperation(
            value = "查询现有下游部件",
            notes = "查询现有下游部件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<TyPartAllVO> queryExistDownStreamPart(@RequestBody BomCondition bomCondition) {
        return ResponseResult.success(this.typlmPartBomService.queryExistDownStreamPart(bomCondition));
    }

    @PostMapping({"/checkUpdateSpareBOM"})
    @ApiOperation(
            value = "校验是否能更新备用bom",
            notes = "校验是否能更新备用bom",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<BigInteger>> checkUpdateSpareBOM(@RequestBody List<BomCondition> bomConditionList) {
        return ResponseResult.success(this.typlmPartBomService.checkUpdateSpareBOM(bomConditionList));
    }

    @PostMapping({"/updateSpareBOM"})
    @ApiOperation(
            value = "更新备用bom",
            notes = "更新备用bom",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<NotificationOption> updateSpareBOM(@RequestBody UpdateSpareBomDTO updateSpareBomDTO) {
        return ResponseResult.success(this.typlmPartBomService.updateSpareBOM(updateSpareBomDTO));
    }

    @GetMapping({"getPartBomOrCadDocEntryMethod"})
    @ApiOperation(
            value = "获取零部件bom、图纸录入方式",
            notes = "获取零部件bom、图纸录入方式",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<CadPartLinkDTO>> getPartBomOrCadDocEntryMethod() {
        return ResponseResult.success(this.typlmPartBomService.getPartBomOrCadDocEntryMethod());
    }

    @GetMapping({"/downloadPartImportTemplate"})
    @ApiOperation(
            value = "下载零部件录入模板",
            notes = "下载零部件录入模板",
            produces = "application/json; charset=utf-8"
    )
    public void downloadPartImportTemplate(HttpServletResponse response) {
        this.typlmPartBomService.downloadPartImportTemplate(response);
    }

    @PostMapping({"/queryParentPartByFilter"})
    @ApiOperation(
            value = "根据子零部件查询父",
            notes = "根据子零部件查询父",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<ParentPartDetailVO>> queryParentPartByFilter(@RequestBody List<BigInteger> partList) {
        return ResponseResult.success(this.typlmPartBomService.queryParentPartByFilter(partList));
    }

    @PostMapping({"/filterPartByOidAndAttrs"})
    @ApiOperation(
            value = "批量替换高级搜索",
            notes = "批量替换高级搜索",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<List<BigInteger>> filterPartByOidAndAttrs(@RequestBody AttrFilterDTO attrFilterDto) {
        return ResponseResult.success(this.typlmPartBomService.filterPartByOidAndAttrs(attrFilterDto));
    }

    @PostMapping({"/batchReplacePart"})
    @ApiOperation(
            value = "批量替换",
            notes = "批量替换",
            produces = "application/json; charset=utf-8"
    )
    @Transactional(
            rollbackFor = {Exception.class}
    )
    public ResponseResult<Boolean> batchReplacePart(@RequestBody List<ReplacePartDTO> repalcePartList) {
        ArgumentUtils.checkArgumentNull(repalcePartList, "BOM批量替换");
        repalcePartList.forEach((vo) -> {
            ArgumentUtils.checkArgumentNull(vo.getPreReplaceChildList(), "BOM批量替换替换前子项");
            ArgumentUtils.checkArgumentNull(vo.getParentPartOid(), "BOM批量替换父项");
            ArgumentUtils.checkArgumentNull(vo.getReplaceChildList(), "BOM批量替换后子项");
        });
        this.typlmPartBomService.batchReplacePart(repalcePartList);
        return ResponseResult.success();
    }

    @PostMapping({"/batchQueryIBAByColumns"})
    @ApiOperation(
            value = "批量查询IBA",
            notes = "批量查询IBA",
            produces = "application/json; charset=utf-8"
    )
    @Transactional(
            rollbackFor = {Exception.class}
    )
    public ResponseResult<List<PartBomTree>> batchQueryPartBomIBA(@RequestBody QueryIBADTO queryIBADTO) {
        ArgumentUtils.checkArgumentNull(queryIBADTO, "查询IBA入参");
        queryIBADTO.getPartNodes().forEach((vo) -> {
            ArgumentUtils.checkArgumentNull(vo.getOid(), "查询IBA入参结构OID");
            ArgumentUtils.checkArgumentNull(vo.getPartTypeOid(), "查询IBA入参类型OID");
        });
        return ResponseResult.success(this.typlmPartBomService.batchQueryPartBomIBA(queryIBADTO));
    }

    @PostMapping({"/quickQueryPartByCondition"})
    @ApiOperation(
            value = "快速查询零部件",
            notes = "快速查询零部件",
            produces = "application/json; charset=utf-8"
    )
    public ResponseResult<PageInfo<ResultEntityVO>> quickQueryPartByCondition(@RequestBody SearchConditionDTO searchConditionDTO) {
        ArgumentUtils.checkArgumentNull(searchConditionDTO, "searchConditionDTO");
        return ResponseResult.success(this.typlmPartBomService.quickQueryPartByCondition(searchConditionDTO));
    }

    @PostMapping({"/splitBom"})
    @ApiOperation(
            value = "BOM拆分",
            notes = "BOM拆分",
            produces = "application/json; charset=utf-8"
    )
    @Transactional(
            rollbackFor = {Exception.class}
    )
    public ResponseResult<BigInteger> splitBom(@RequestBody SplitBOMDTO splitBOMDTO) {
        ArgumentUtils.checkArgumentNull(splitBOMDTO, "BOM拆分入参");
        return ResponseResult.success(this.typlmPartBomService.splitBom(splitBOMDTO));
    }

    @PostMapping({"/combineBom"})
    @ApiOperation(
            value = "BOM合并",
            notes = "BOM合并",
            produces = "application/json; charset=utf-8"
    )
    @Transactional(
            rollbackFor = {Exception.class}
    )
    public ResponseResult<BigInteger> combineBom(@RequestBody List<CTyEntityBaseDO> cTyEntityBaseDOList) {
        ArgumentUtils.checkArgumentNull(cTyEntityBaseDOList, "BOM合并入参");
        return ResponseResult.success(this.typlmPartBomService.combineBom(cTyEntityBaseDOList));
    }
}
